package com.xing.cglib;

import net.sf.cglib.proxy.Enhancer;

public class Main {

    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(HelloService.class);//继承被代理类
        enhancer.setCallback(new HelloMethodInterceptor());//设置回调
        HelloService helloService = (HelloService) enhancer.create();
        helloService.doRun();
    }
}
